package JavaShengSai;

import java.util.Scanner;

/**
 * 3. 门牌制作
 * https://www.lanqiao.cn/problems/592/learning/?problem_list_id=2&page=1&tag_relation=intersection&tags=2020
 */
public class Main3 {
    public static void main(String[] args) {
        Scanner scan = new Scanner(System.in);
        //在此输入您的代码...
        int count = 0;
        for(int i = 1;i <= 2020;i++) {
            int x = i;
            while(x != 0) {
                if(x % 10 == 2) {
                    count++;
                }
                x /= 10;
            }
        }
        System.out.println(count);
        scan.close();
    }
}
